﻿using System.ServiceProcess;
using System.Threading;
using GatewayBizProcess.Facade;
using log4net;

namespace GatewayBizProcess
{
    public partial class TinzDataGateway : ServiceBase
    {
        static ILog log = LogManager.GetLogger(typeof(TinzDataGateway));
        public TinzDataGateway()
        {
            InitializeComponent();
        }
        //test
        public void Main()
        {
            OnStart(null);
        }
        protected override void OnStart(string[] args)
        {
            //启动各路线程
            new Thread(new Upline().ProcessBizMsg).Start();
            new Thread(new Downline().SendData).Start();
            new Thread(new Downline().SendCtrCmd).Start();
            new Thread(new Sync().DataSync2011).Start();
            new Thread(new Sync().DataSync2061).Start();
            log.Info( "Service Started!");
        }
        protected override void OnStop()
        {
            log.Info( "Service Stop!");
        }
    }
}
